package com.zh.api.controller.goods;


import com.zh.common.utils.PageUtils;
import com.zh.common.utils.Query;
import com.zh.goods.domain.GoodsRecordDO;
import com.zh.goods.service.GoodsRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 商品进货记录
 * 
 * @author chglee
 * @email 1992lcg@163.com
 * @date 2019-01-17 10:15:32
 */
 
@Controller
@RequestMapping("/goods/goodsRecord")
@Api("商品进货记录")
public class GoodsRecordController {
	@Autowired
	private GoodsRecordService goodsRecordService;
	
	@ResponseBody
	@RequestMapping(value = "list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	@ApiOperation("获取商品进货记录列表")
	public PageUtils list(@RequestBody Map<String, Object> params){
		//查询列表数据
        Query query = new Query(params);
		List<GoodsRecordDO> goodsRecordList = goodsRecordService.list(query);
		int total = goodsRecordService.count(query);
		PageUtils pageUtils = new PageUtils(goodsRecordList, total);
		return pageUtils;
	}
}
